/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 *
 */

import os from 'os';

/**
 * 池化管理模块的常量
 *
 * @since 2022/8/15
 */
export class PoolConstant {
  static readonly MAX_POOL_NUM: number = os.cpus().length - 1;
  static readonly MIN_POOL_NUM: number = 0;
  static readonly DEFAULT_MAX_IDLE_TIME: number = 600000;
  static readonly DEFAULT_RECYCLE_INTERVAL: number = 600000;
  static readonly WORKER_ACTION_PATH: string = './worker-action.js';
  static readonly WORK_DONE: string = 'work done';
  static readonly WORK_ERROR: string = 'work error';
  static readonly CALLBACK_ERROR: string = 'callback error';
  static readonly FILE_SUFFIX: string = '.js';
  static readonly UNKNOWN_LOG_TIME: string = 'unknown';
  static readonly ENCODING: string = 'utf8';
  static readonly TIME_PREFIX_LENGTH: number = 25;
  static readonly CPU_LIMIT: number = 0.8;
  static readonly FAIL_DISPATCH_INTERVAL: number = 100;
  static readonly MAX_FAIL_ATTEMPTS: number = 5;
  static readonly UNMOUNT_TSC_COMMON_CACHE_EVENT = 'unmountTscCommonCache';
  static readonly CLEAN_HVIGOR_CONFIG_LOADER = 'initHvigorConfigLoader';
  static readonly TSC_COMMON_CACHE_KEY = 'common';
  static readonly CLEAN_HVIGOR_LOGGER = 'cleanHvigorLogger';
}
